﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;

public struct NetMessage :NetworkMessage
{
    /// <summary>
    /// 该字典通过定义byte（传输双方约定发送数据）
    /// </summary>
    public Dictionary<byte, object> ParameterDic 
    {
        get;
        set;
    }

    public object this[byte parameterKey]
    {
        get
        {
            return ParameterDic[parameterKey];
        }
        set
        {
            ParameterDic[parameterKey] = value;
        }
    }

    /// <summary>
    /// 区域码
    /// </summary>
    public byte AreaCode { get; set; }

    /// <summary>
    /// 操作码
    /// </summary>
    public byte OperationCode { get; set; }

    /// <summary>
    /// 子操作码
    /// </summary>
    public byte SubCode { get; set; }

    /// <summary>
    /// 返回码
    /// </summary>
    public byte ReturnCode { get; set; }

    //public NetMessage(byte areaCode, byte operationCode, Dictionary<byte, object> parameters)
    //{
    //    AreaCode = areaCode;
    //    OperationCode = operationCode;
    //    ParameterDic = parameters;
    //}

    //public NetMessage(byte areaCode, byte operationCode)
    //{
    //    AreaCode = areaCode;
    //    OperationCode = operationCode;
    //}
    //public NetMessage(byte areaCode)
    //{
    //    AreaCode = areaCode;

    //}

    //public NetMessage()
    //{
    //}


}
